const BASE_URL = "https://8c0ca265-f640-4eda-a886-92bd742a95fa.bspapp.com/http";

const http = (url, method, param, token) => {
	uni.showLoading({
		title: "加载中..."
	})

	return new Promise((resolve, reject) => {
		uni.request({
			url: BASE_URL + url,
			method: method || "GET",
			header: {
				token: token || ""
			},
			data: param || {},
			success(res) {
				resolve(res);
			},
			fail(err) {
				reject(err);
			},
			complete() {
				uni.hideLoading();
			}
		})
	});
}

export {
	http
}
